<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Pilferpage</title>
	<link rel="stylesheet" type="text/css" href="screen.css" media="screen"/>
	<script type="text/javascript">

	function setThePreviewIframeHeight(event)
		{
		var thePreviewIframe = document.getElementById("thePreviewIframe")
		if(!thePreviewIframe) return

		var minimumHeight = 30;
		var browserHeight = 0;
		if(window.innerHeight)
			{
			browserHeight = window.innerHeight;
			}
		else if(document.body.clientHeight)
			{
			browserHeight = document.body.clientHeight;
			}
		var newHeight = browserHeight - 275;
		if(newHeight < minimumHeight)
			{
			newHeight = minimumHeight;
			}
		thePreviewIframe.style.height = newHeight + "px";
		}

	</script>

</head>
<body onload="setThePreviewIframeHeight()">
<?php

include_once('header.php');

if(isset($_GET['file']))
	{
	print '<div class="iframeContainer"><iframe id="thePreviewIframe" src="pilferpage.php?file=';
	print sanitiseStringToAlphaNumeric($_GET['file']);
	if(isset($_GET['format'])) print '&amp;format='.sanitiseStringToAlphaNumeric($_GET['format']);
	print '"></iframe></div>';
	}
?>
</body>
</html>
